package org.bob.learn.consumer.api.producer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ProducerApiServiceFallbackFactory implements FallbackFactory<ProducerApiService> {

    private static final String MSG_REP = new String("FALLBACK");


    @Override
    public ProducerApiService create(Throwable cause) {
        log.error(cause.getMessage());
        return req -> MSG_REP;
    }
}
